/*
 * $Id: BasicTask.java,v 1.7 2009/05/08 20:15:24 navdeep_mahajan Exp $
 * 
 * Copyright (C) 2008 General Electric Company. All Rights Reserved.
 * 
 * This software is the confidential and proprietary information of the General
 * Electric Company (GE). You shall not disclose this software and shall use it
 * only in accordance with the terms of the license agreement you entered into
 * with GE.
 * 
 * GE MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
 * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
 * NON-INFRINGEMENT. GE SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE
 * AS A RESULT OF USING, MODIFYING, OR DISTRIBUTING THIS SOFTWARE OR ITS
 * DERIVATIVES.
 */
package com.ge.healthcare.autosc.processor.dispatcher.tasks;

import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.util.Assert;

import com.ge.healthcare.autosc.common.database.dao.ITaskDAO;
import com.ge.healthcare.autosc.common.database.pojo.ActTask;

/**
 * 
 * @author 212042946
 * 
 */
public abstract class BasicTask implements ProcessorTask, InitializingBean,
		FactoryBean {

	protected static ITaskDAO iTaskDAO = null;

	public abstract void executeTask(ActTask actTask);

	public void afterPropertiesSet() throws Exception {
		Assert
				.notNull(iTaskDAO,
						"ActRequestDAO object is required. Use setActTaskDAO() to provide one.");
	}

	public void setActTaskDAO(ITaskDAO iTaskDAO) {
		BasicTask.iTaskDAO = iTaskDAO;
	}

	public Object getObject() throws Exception {
		return this.getClass().newInstance();
	}

	public Class<?> getObjectType() {
		return this.getClass();
	}

	public boolean isSingleton() {
		return false;
	}
}
